Skip to content

Conversation

@seekstar
Copy link

I need to compare String and str in my data structure, and this PR enables Natural to do that by allowing comparison between all types and their borrowed representation.

@tisonkun
Copy link

@seekstar I meet this similar issue and use comapre::natural::<str>().borrowing() to implement. This should work for you also :D

@seekstar
Copy link
Author

Thank you for the suggestion. But in fact I'm using compare to constrain the argument type of an interface, where Q is the type of key to search in a tree of T, and therefore T and Q is not necessarily String and str. I think in my case impl compare<T, Q> for Natural<T> where T: Borrow<Q> is more suitable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants